<%@page contentType="text/html" pageEncoding="UTF-8" session="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet"
	href="${pageContext.servletContext.contextPath}/styles/default.css" />
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

<title>Login</title>
</head>
<body>
	<header>
		<c:import url="/WEB-INF/JSP/menu.jsp" />
		<h1>Login</h1>
	</header>
	<form method='post' action='<c:url value="/j_spring_security_check"/>'>
		<label for="j_username">Username <c:if test="${param.error}">
				<span class="error">Incorrect username or password</span>
			</c:if>
		</label> <input name="j_username" id="j_username" /> <label for="j_password">Password</label>
		<input type="password" name="j_password" id="j_password" /> <input
			type="submit" value="Login as an existing customer" />
		<c:url value="/customers/create" var="createCustomerURL" />
		<div>
			<a href="${createCustomerURL}">Register as a new customer</a>
		</div>
	</form>
	<script>
		$(function() {
			$("#j_username").focus();
		});
		</script>
</body>
</html>
